function init(id) {
	
	var bs = document.createElement("button");
	bs.innerHTML = "service";
	d("util").appendChild(bs);
	var bp = document.createElement("button");
	bp.innerHTML = "proxy";
	d("util").appendChild(bp);
	
	var ran = id;

	bs.onclick = function(){
		function Foo() {
			var h = 0;
			this.inc = function() {
				return h++;
			}
		}
		TITT.register(new Foo(), "js", "foo", ran);
	}
	
//	bs.onclick();
	
	bp.onclick = function(){
		var p = TITT.createProxy("js", "foo", ran);
		out(p.inc());
	}
		
//	});}
	
	/*
	var b = document.createElement("button");
	b.innerHTML = "click";
	d("util").appendChild(b);
	
	var f = d("test");
	
	var n = TITTNuder.createProxy("test");
	
	var p = TITT.createProxy("foo");
	
	b.onclick = function() {
		out(n.post(p.bar(), new NuderRequest(f)).getBody());
	}
	*/
}

/*
window.TITTSyncing = new function() {
	this.sync = function(f) {
		
		function syncf() {
			var args = "";
			for(var i = 0; i < syncf.arguments.length; i++)
				args += "syncf.arguments["+i+"],";
			
			var fu = new Future();
			
			eval("f("+args+"fu.fulfill);");
			
			return fu.result();
			
		}
		
		return syncf;
	}
}
*/
function d(id) {
	return document.getElementById(id);
}

function out(str) {
	d("out").innerHTML += str + "<br/>";
}
